package com.pat.java.base;

import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.math.BigInteger;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Random;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.Element;
import org.dom4j.io.SAXReader;

import com.danga.MemCached.MemCachedClient;
import com.danga.MemCached.SockIOPool;
import com.pat.java.base.obj.Item;
import com.pat.java.tools.ListUtil;
import com.ppsea.Utils;

public class Test {
	
	
	/**
	 * 测试Boolean
	 */
	public static void testBoolean(){
		boolean boo = false;
		
		Map<String,Object> contain = new HashMap<String,Object>();
		contain.put("boolean", boo);
		
		System.out.println("boo..."+contain.get("boolean"));
		System.out.println(contain.get("boolean") != null);
		System.out.println(contain.get("boolean") == Boolean.valueOf(false));
//		System.out.println(contain.get("boolean") == boo);
		System.out.println(contain.get("boolean") == "false");
		if(contain.get("boolean") != null){
			System.out.println("ssss");
		}
	}
	
	/**
	 * 测试Collection排序
	 */
	public static void testCollectionSort(){
		List<Integer> list = new ArrayList<Integer>();
		list.add(11);
		list.add(23);
		list.add(10);
		list.add(16);
		list.add(44);
		list.add(9);
		
		System.out.println("before list:"+ ListUtil.getList2String(list));		
		//-1 不交换, 1 交换
		Collections.sort(list, new Comparator<Integer>() {
			public int compare(Integer a, Integer b) {
				return (a < b) ? -1 : 1;	//a > b return -1 降序排列,否则顺序排列
			}
		});		
		
		System.out.println("after list:"+ ListUtil.getList2String(list));	
	}
	
	/**
	 * for循环第一种形式,当list为null时,则报NullPoiterException空指针异常.
	 */
	@SuppressWarnings("null")
	public static void testForLoop(){
		List<String> strList = null;
//		List<String> strList = new ArrayList<String>();
//		int i = 0;
//		for (String string : strList) {
//			System.out.println(" list element"+i+string);
//			i++;
//		}
		for (int i=0;i<strList.size();i++) {
			System.out.println(" list element"+i+strList.get(i));
		}
	}
	
	/**
	 * 测试http发送Get/Post请求
	 * @param url
	 */
	public static String testHttpUrlConnection(String url){
		URL objUrl;
		try {
			objUrl = new URL(url);
			 HttpURLConnection conn = (HttpURLConnection)objUrl.openConnection();
		        conn.setDoOutput(true);
		        conn.setDoInput(true);
		        conn.setUseCaches(false);
		        conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
		        conn.setRequestProperty("User-Agent", "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)");
		        conn.setRequestMethod("GET");
//		        conn.setConnectTimeout(125);
//		        conn.setReadTimeout(125);
		        conn.connect();
				/*conn.setDoInput(true);
				conn.setDoOutput(true);
				conn.setRequestMethod("Post");
				conn.setUseCaches(false);
				conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
				conn.connect();*/
		        InputStream inputStrm = conn.getInputStream();
		        BufferedReader buffRead = new BufferedReader(new InputStreamReader(inputStrm, "UTF-8"));
				String tmpStr = buffRead.readLine();
		      /*  BufferedInputStream inStream = new BufferedInputStream(conn.getInputStream());
		        ByteArrayBuffer buffer = new ByteArrayBuffer();
		        conn.disconnect();
		        byte[] b = new byte[1024];
		        int len;
		        while ((len = inStream.read(b)) != -1)
		        {
		          buffer.write(b, 0, len);
		          buffer.flush();
		        }
		        b = (byte[])null;*/
				String result = "";
				while(tmpStr != null){
					result += tmpStr+"\r\n";
					tmpStr = buffRead.readLine();
				}
				inputStrm.close();
		        
		        System.out.println("the buffer=>"+result);
		        return result;
		} catch (Exception exception) {
			exception.printStackTrace();
		}
		return null;
	}
	
	/**
	 * 测试对象引用改变某值,存储在各种容器(数据机构)中的引用值的变化
	 */
	public static void testList(){
		List<Item> items = new ArrayList<Item>();
		Map<String,Object> tempData = new  HashMap<String,Object>();
		
		for(int i=0;i<3;i++){
			Item item = new Item();
			item.setId(i);
			item.setName("I"+i);
			items.add(item);
		}
		tempData.put("itemsObj", items);
		
		@SuppressWarnings("unchecked")
		List<Item> itemLst = (List<Item>) tempData.get("itemsObj");
		int m = 3;
		for (Item item : itemLst) {
			item.setId(m);
			item.setName("M"+m);
			m *= 2;
		}
		/*
		 * list是容器,容器中存的对象引用
		 * 当再赋值给另一个引用,并改变引用的值,容器中的引用的值也会改变.
		 * 对象的引用犹如C语言中的指针.
		 */
		@SuppressWarnings("unchecked")
		List<Item> itemLst1 = (List<Item>) tempData.get("itemsObj");
		for (Item item : itemLst1) {
			System.out.println("Item id:"+item.getId()+" name:"+item.getName());
		}
	}
	
	/**
	 * 测试JDBC连接
	 */
	public static void testMySql(){
		String driver = "com.mysql.jdbc.Driver"; // mysql数据库驱动
		// URL非仙本地资源库xx_res 
		//jdbc:mysql://127.0.0.1:3306/xx_res (or jdbc:mysql://localhost/xx_res)
		String database = "xmy_res_wap";
		String url = "jdbc:mysql://127.0.0.1:3306/"+database;
		String user = "ppseaer"; // MySQL用户名
		String password = "ppseaer@ppsea.com"; // MySQL密码
		try {
			Class.forName(driver); 	// 发射加载数据库驱动
			Connection conn = DriverManager.getConnection(url, user, password); // 根据驱动管理获得数据库连接

			if (!conn.isClosed())
				System.out.println("Succeeded connecting to the Database!"); // 连接是否关闭
			/*
			 * 1.PreparedStatement是预编译的,对于批量处理可以大大提高效率. 也叫JDBC存储过程
			 * 2.使用 Statement 对象。在对数据库只执行一次性存取的时侯，用 Statement 对象进行处理。
			 * 		PreparedStatement 对象的开销比Statement大，对于一次性操作并不会带来额外的好处。
			 * 3.statement每次执行sql语句,相关数据库都要执行sql语句的编译,preparedstatement是预编译得,preparedstatement支持批处理
			 */			
			Statement statement = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE); // statement用该连接发送 SQL语句
			
			/*String sql = "select * from box where box_key=-4"; 

			ResultSet rs = statement.executeQuery(sql);
			
			StringBuilder strBuilder = new StringBuilder();
			while (rs.next()) {

				String itemId = rs.getString("prize_item"); //
				String num = rs.getString("prize_item_num");
				String prop = rs.getString("prize_prob");

				strBuilder.append(itemId).append("_").append(num).append("_").append(prop).append("_0|");
			}
			System.out.println("the builder string:"+strBuilder.toString());
			
			String tmpStr = "10156_1_100_0|10157_1_100_0|10158_1_100_0|10159_1_100_0|" +
					"10160_1_100_0|10121_1_200_0|10122_1_200_0|10123_1_200_0|" +
					"10124_1_200_0|10125_1_200_0|10226_1_80_0|10227_1_80_0|" +
					"10228_1_80_0|10229_1_80_0|10230_1_80_0|10191_1_160_0|" +
					"10192_1_160_0|10193_1_160_0|10194_1_160_0|10195_1_160_0|" +
					"10296_1_60_0|10297_1_60_0|10298_1_60_0|10299_1_60_0|" +
					"10300_1_60_0|10261_1_140_0|10262_1_140_0|10263_1_140_0|" +
					"10264_1_140_0|10265_1_140_0|10366_1_40_0|10367_1_40_0|" +
					"10368_1_40_0|10369_1_40_0|10370_1_40_0|10331_1_120_0|" +
					"10332_1_120_0|10333_1_120_0|10334_1_120_0|10335_1_120_0|" +
					"10436_1_20_0|10437_1_20_0|10438_1_20_0|10439_1_20_0|" +
					"10440_1_20_0|10401_1_100_0|10402_1_100_0|10403_1_100_0|" +
					"10404_1_100_0|10405_1_100_0|10151_1_200_0|10152_1_200_0|" +
					"10153_1_200_0|10154_1_200_0|10155_1_200_0|10116_1_80_0|" +
					"10117_1_80_0|10118_1_80_0|10119_1_80_0|10120_1_80_0|" +
					"10221_1_160_0|10222_1_160_0|10223_1_160_0|10224_1_160_0" +
					"|10225_1_160_0|10186_1_60_0|10187_1_60_0|10188_1_60_0|" +
					"10189_1_60_0|10190_1_60_0|10291_1_140_0|10292_1_140_0|" +
					"10293_1_140_0|10294_1_140_0|10295_1_140_0|10256_1_40_0|" +
					"10257_1_40_0|10258_1_40_0|10259_1_40_0|10260_1_40_0|" +
					"10361_1_120_0|10362_1_120_0|10363_1_120_0|10364_1_120_0|" +
					"10365_1_120_0|10326_1_20_0|10327_1_20_0|10328_1_20_0|" +
					"10329_1_20_0|10330_1_20_0|10431_1_20_0|10432_1_20_0|" +
					"10433_1_20_0|10434_1_20_0|10435_1_20_0|10396_1_120_0|" +
					"10397_1_120_0|10398_1_120_0|10399_1_120_0|10400_1_120_0,-1_1_55_0|" +
					"-2_1_35_0|-3_1_10_0,1022_1_5_0|1020_1_10_0|30579_1_5_0|" +
					"30728_1_5_0|30704_1_1_0|30708_1_1_0|30064_1_35_0|30034_1_38_0";
			System.out.println(tmpStr.substring(0, tmpStr.indexOf(",-1_1_55_0"))
					.equals(strBuilder.toString().substring(0, strBuilder.indexOf("|30505_1_1_0|30506_1_1_0|"))));
			rs.close();*/
			String sql = "select * from config_compose where id >=41 and id <=70";
			ResultSet rs = statement.executeQuery(sql);
			
			int index = 1;
			while (rs.next()) {
				index = index == 6 ? 1 : index;	//5个一轮
				
				int money = 0,iron = 0;
				switch (index) {
				case 1:
					money = 3200;
					iron = 768;
					break;
				case 2:
					money = 9600;
					iron = 1116;				
					break;
				case 3:
					money = 18000;
					iron = 1476;
					break;
				case 4:
					money = 56000;
					iron = 1956;
					break;
				case 5:
					money = 89000;
					iron = 3544;
					break;
				}
				index++;
				int id = Integer.valueOf(rs.getString("id"));
				sql = "update config_compose set money="+money+",iron="+iron+" where id="+id+";";
				System.out.println(sql);
			}
			rs.last();
			System.out.println("resultSet size>>>>"+rs.getRow());
			rs.close();
			conn.close();
		} catch (ClassNotFoundException e) {
			System.out.println("Sorry,can`t find the Driver!");
			e.printStackTrace();

		} catch (SQLException e) {
			e.printStackTrace();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
	/**
	 * 测试unicode
	 */
	public static void testUnicode(){
		System.out.println('\u0000');
		System.out.println('\uffff');
		
		for(char c = ' ';c>'\u0000' && c < '\uffff';c++){
			System.out.println(c);
		}
		
		byte b = (byte) ( 1 << 4 | 7);
		byte a = b;
		
		System.out.println(a);
	}
	
	/**
	 * 测试时间转换
	 */
	public static void testTimeFormat(){
		SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		String last_time = format.format(new Date(System.currentTimeMillis()));
		last_time = last_time.substring(0, 16);	//(年-月-日 时:分)
		
		System.out.println("lastTime:"+last_time);
	}
	
	/**
	 * int值区间-2147483648~2147483647
	 * 小于最小值或大于最大值都会溢出,并正的变负的,负的变正的
	 */
	public static void testInt(){
		int i;
		i = (int) Math.pow(2, 32);
		System.out.println("before i:"+i);
		
		i++;
		
		System.out.println("after i:"+i);
		
		i-=2;
		
		System.out.println("last i:"+i);
	}
	
	/**
	 * 线程池
	 */
	public static void testThreadPool(){
		// 生成固定大小为2的线程池
		ExecutorService exec = Executors.newFixedThreadPool(2);
		for (int index = 0; index < 10; index++) {
			Runnable runnable = new Runnable() {
				public void run() {
					long time = (long) (Math.random() * 1000);
					System.out.println("Sleeping " + time + "ms");
					try {
						Thread.sleep(time);
					} catch (InterruptedException e) {
						//e.printStackTrace();
					}
				}
			};
			// 向线程池中提交任务
			exec.execute(runnable);
		}
		// 关闭线程池
		exec.shutdown();
	}
	
	/**
	 * 获得当前时间加上n天后的int时间。
	 * @param days
	 */
	public static void getTimeAfterDays(int days){
		System.out.println((System.currentTimeMillis() + days * 24 * 60 * 60 * 1000L) / 1000);
	}
	
	/**
	 * 获得当前时间减去n天前的int时间。
	 * @param days
	 */
	public static void getTimeBeforeDays(int days){
		System.out.println((System.currentTimeMillis() - days * 24 * 60 * 60 * 1000L) / 1000);
	}
	
	/**
	 * 将单位为秒的int时间转化成字符串时间
	 * @param seconds
	 */
	public static void parseTime(int seconds){
		System.out.println("the time:"+new SimpleDateFormat("yyyy/MM/dd HH:mm:ss").format(new Date(seconds*1000L)));
	}
	
	/**
	 * 获得某OpenId对应的hashcode、hashcode对应的服务器
	 * @param pid
	 * @param num
	 */
	public static void getNum(String pid,int num){
		System.out.println("userId:"+pid);
		System.out.println("totalServerNum:"+num);
		System.out.println("pid2Hash:"+Math.abs(pid.hashCode()));
		System.out.println("serverNum:"+Math.abs(pid.hashCode()) % num);
	}
	
	/**
	 * 获得比较两个不同OpenId的hashcode大小
	 * @param pid1
	 * @param pid2
	 */
	public static void getBigHashCode(String pid1, String pid2){
		System.out.println(Math.abs(pid1.hashCode()) > Math.abs(pid2.hashCode()) ? pid1 : pid2); 
	}
	
	/**
	 * 测试多线程发请求
	 */
	public static void testMultithreadingRequest(final String url){
		System.out.println("the url:"+url);
		Thread th1 = new Thread(new Runnable() {
			public void run() {
				System.out.println("th1 start..");
				testHttpUrlConnection(url);
				System.out.println("th1 send req end..");
//				try {
//					Thread.sleep(1000);//一秒钟发一次请求
//				} catch (InterruptedException e) {
//					e.printStackTrace();
//				}
			}
		});
		th1.start();
		
		Thread th2 = new Thread(new Runnable() {
			public void run() {
				System.out.println("th2 start..");
				testHttpUrlConnection(url);
				System.out.println("th2 send req end..");
//				try {
//					Thread.sleep(1000);//一秒钟发一次请求
//				} catch (InterruptedException e) {
//					e.printStackTrace();
//				}
			}
		});
		th2.start();
		
		Thread th3 = new Thread(new Runnable() {
			public void run() {
				System.out.println("th3 start..");
				testHttpUrlConnection(url);
				System.out.println("th3 send req end..");
//				try {
//					Thread.sleep(100);//一秒钟发一次请求
//				} catch (InterruptedException e) {
//					e.printStackTrace();
//				}
			}
		});
		th3.start();
	}
	
	public static void testJavaUrlEncode(){
//		String str = "http://xmy.2022m.nj.twsapp.com/i?cpid=1024&gameid=2022&app=16491c&sid=&uid=";
//		try {
//			System.out.println(java.net.URLEncoder.encode(str, "utf-8"));
//		} catch (UnsupportedEncodingException e) {
//			e.printStackTrace();
//		}
		
		String str = "http://localhost:8080/admin?cmd=m_UPlD|123456|1_";
		try {
			
			String name = java.net.URLEncoder.encode("成就", "utf-8");
			
			String url = str + name ;
			System.out.println(url);
			
			testHttpUrlConnection(url);			
		} catch (UnsupportedEncodingException e) {
			e.printStackTrace();
		}
	}
	
	public static void testFXWRAdminIntegerfaceBanAccount(int zoneId, int type, String[] keyWords){
		String domain = "";
		if(zoneId == 1){
			domain = "http://fxwr.nj.twsapp.com";
		}else if(zoneId == 2){
			domain = "http://fxwrb.2022n.nj.twsapp.com";
		}else if(zoneId == 3){
			domain = "http://fxwrc.2022m.nj.twsapp.com";
		}
		String url = domain + "/admin?cmd=m_adw|16491c952a88418495e6e37433507157|";
		 //封号
		if(type == 1){
			url += "2_1825_5_";
		}else{//禁言
			url += "1_7_1_";
		}
//		String[] keyWords = {"1944981482"};
		for (String word : keyWords) {
			try {
				testHttpUrlConnection(url + URLEncoder.encode(word, "utf-8"));
			} catch (UnsupportedEncodingException e) {
				e.printStackTrace();
			}
		}
	}
	
	public static void testMutilThreadXMYAdminInterface(){
		String url1 = "http://xmy.2022m.nj.twsapp.com/0/admin/0/m_AG|257|1_1";
//		String url2 = "http://localhost:16100/0/m_AW|2|10_1";
//		String url3 = "http://localhost:16100/0/m_AIr|2|10_1";
		String[] urlList = {url1};
		for(int index=0; index < 10; index++){
			for(String url : urlList){
				testMultithreadingRequest(url);
			}
		}
	}
	
	private static void invokeXMYAdminInterface(){
//		String url = "http://xmy.2022m.nj.twsapp.com/0/admin/0/m_AI|";
		String url = "http://localhost:16100/0/m_AI|";
		int[] playerIdList = {206194,207468,240084,222004,7428,2,85230,40855,63955,187346,10596,10903,1761,213840,2693,5058,61801,70770,83035};
		int[] amountList = {36,30,22,16,10,8,8,6,6,4,2,2,2,2,2,2,2,2,2};
		int itemId = 2145;
		
		for(int i=0;i<playerIdList.length;i++){
			int playerId = playerIdList[i];
			int amount = amountList[i];
			
			String tmp = url + playerId+"|"+itemId+"_"+amount+"_1";
			System.out.println(tmp);
			testHttpUrlConnection(tmp);
		}
	}
	
	private static void invokeFxwrAdminInterface(){
		String url = "http://localhost:8080/admin?cmd=m_AI|";
		int beginItemId = 30981;
		int endItemId = 31005;
		int amount = 10;
		
		for(int i=beginItemId;i<=endItemId;i++){
			
			String tmp = url + "1231233|"+i+"_"+amount+"_1";
			System.out.println(tmp);
			testHttpUrlConnection(tmp);
		}
	}
	
	public static class MyRunnable implements Runnable{
		private Item item = new Item();
		
		@Override
		public void run() {
			while(item.getFlag() == 0){
				System.out.println("loop print flag="+item.getFlag());
			}
			while(item.getFlag() == 2){
				System.out.println("loop print flag="+item.getFlag());
			}
			System.out.println("out of loop print flag="+item.getFlag());
		}
		public Item getItem() {
			return item;
		}
		
	}
	/**
	 * 测试线程共享数据,通过开关数据,停掉正在执行的任务
	 */
	private static void testThreadShareData(){
		
		MyRunnable my = new MyRunnable();
		
		new Thread(my).start();
		
		my.getItem().setFlag(1);	//改变标识
		
		my.getItem().setFlag(2);	//改变标识
		
		new Thread(my).start();
	}
	
	/**
	 * 获得非仙特殊书签
	 * @param uid
	 * @param zoneId
	 * @param cmd
	 * @param ps
	 */
	public static String getFxwrSpecialMarkbook(String uid, int zoneId, boolean isLocal, String cmd, String ps){
		String url = Utils.specialFxwrBookMark(uid, zoneId, isLocal, cmd, ps);
		System.out.println(url);
		
		return url;
	}
	
	/**
	 * 获得仙魔妖特殊书签
	 * @param uid
	 * @param zoneId
	 * @param cmd
	 * @param ps
	 */
	public static String getXMYSpecialMarkbook(String uid, int zoneId, boolean isLocal, String cmd, String ps){
		String url = Utils.specialXmyBookMark(uid, zoneId, isLocal, cmd, ps);
		System.out.println(url);
		
		return url;
	}
	
	private static void analyzeLottery(String dataStr){
		
	}
	
	@SuppressWarnings("unchecked")
	private static void testRegExpress() throws DocumentException{
		String str = "<div class=\"tb_bg\"><div class=\"box\"><div id=tab_kj><div class=menubox_kj><ul id=\"lotTab\"><div style=\"float:right; padding-top:4px; padding-right:6px; color:#ffff00;\"><select name=\"shengList\" id=\"shengList\"></select>&nbsp;<select name=\"lottList\" id=\"lottList\"></select>&nbsp;<input type=\"button\" id=\"selectBn\" value=\" 查 询\" name=\"Submit\" class=\"down_bot2\"></div><div class=\"tb_2\" ><strong>超级大乐透－开奖号码分布图</strong></div><li class=\"hover\">基本走势</li><li>高级走势</li><li>K线图</li><li>直方图</li><li>遗漏统计</li><li>跟随统计</li></ul></div><div class=\"contentbox_kj\" id=\"lotContent\" ><div class=hover id=\"show0\"><input onClick=\"chartOpen(20001, 0, 0, '', 0)\" class=\"tbbot tre tb\" type=\"button\" value=\"开奖号码分布图\"><input onClick=\"chartOpen(20002, 0, 0, '', 0)\" class=\"tbbot\" type=\"button\" value=\"综合走势图\"><input onClick=\"chartOpen(20003, 0, 0, '', 0)\" class=\"tbbot\" type=\"button\" value=\"定位走势图\"><input onClick=\"chartOpen(20004, 0, 0, '', 0)\" class=\"tbbot\" type=\"button\" value=\"奇偶走势图\"><input onClick=\"chartOpen(20005, 0, 0, '', 0)\" class=\"tbbot\" type=\"button\" value=\"大小走势图\"><input onClick=\"chartOpen(20006, 0, 0, '', 0)\" class=\"tbbot\" type=\"button\" value=\"质合走势图\"><input onClick=\"chartOpen(20007, 0, 0, '', 0)\" class=\"tbbot\" type=\"button\" value=\"012路走势图\"><input onClick=\"chartOpen(20016, 0, 0, '', 0)\" class=\"tbbot\" type=\"button\" value=\"升平降走势图\"><input onClick=\"chartOpen(20008, 0, 0, '', 0)\" class=\"tbbot\" type=\"button\" value=\"号码个数走势图\"><input onClick=\"chartOpen(20015, 0, 0, '', 0)\" class=\"tbbot\" type=\"button\" value=\"余数和走势图\"><input onClick=\"chartOpen(20009, 0, 0, '', 0)\" class=\"tbbot\" type=\"button\" value=\"和值走势图\"><input onClick=\"chartOpen(20010, 0, 0, '', 0)\" class=\"tbbot\" type=\"button\" value=\"跨度走势图\"><input onClick=\"chartOpen(20011, 0, 0, '', 0)\" class=\"tbbot\" type=\"button\" value=\"平均值走势图\"><input onClick=\"chartOpen(20020, 0, 0, '', 0)\" class=\"tbbot\" type=\"button\" value=\"合跨走势图\"><input onClick=\"chartOpen(20019, 0, 0, '', 0)\" class=\"tbbot\" type=\"button\" value=\"尾数类型走势图\"><input onClick=\"chartOpen(20111, 0, 0, '', 0)\" class=\"tbbot\" type=\"button\" value=\"综合数据统计表\"></div><div class=hover id=\"show1\"  style=\"display: none\"><input onClick=\"chartOpen(20017, 0, 0, '', 1)\" class=\"tbbot\" type=\"button\" value=\"定位振幅走势图\"><input onClick=\"chartOpen(20018, 0, 0, '', 1)\" class=\"tbbot\" type=\"button\" value=\"指标振幅走势图\"><input onClick=\"chartOpen(20021, 0, 0, '', 1)\" class=\"tbbot\" type=\"button\" value=\"加权均值走势图\"><input onClick=\"chartOpen(21001, 0, 0, '', 1)\" class=\"tbbot\" type=\"button\" value=\"尾数分组分布\"><input onClick=\"chartOpen(21004, 0, 0, '', 1)\" class=\"tbbot\" type=\"button\" value=\"连号分布图\"><input onClick=\"chartOpen(21002, 0, 0, '', 1)\" class=\"tbbot\" type=\"button\" value=\"间距分布图\"><input onClick=\"chartOpen(21003, 0, 0, '', 1)\" class=\"tbbot\" type=\"button\" value=\"区间分布图\"><input onClick=\"chartOpen(20055, 0, 0, '', 1)\" class=\"tbbot\" type=\"button\" value=\"号码类型分布图\"><input onClick=\"chartOpen(20054, 0, 0, '', 1)\" class=\"tbbot\" type=\"button\" value=\"号码旋转分布图\"><input onClick=\"chartOpen(20051, 0, 0, '', 1)\" class=\"tbbot\" type=\"button\" value=\"冷温热分布图\"><input onClick=\"chartOpen(20052, 0, 0, '', 1)\" class=\"tbbot\" type=\"button\" value=\"邻孤传分布图\"><input onClick=\"chartOpen(21203, 0, 0, '', 1)\" class=\"tbbot\" type=\"button\" value=\"江恩螺旋统计表\"><input onClick=\"chartOpen(21204, 0, 0, '', 1)\" class=\"tbbot\" type=\"button\" value=\"号码行列统计表\"><input onClick=\"chartOpen(21205, 0, 0, '', 1)\" class=\"tbbot\" type=\"button\" value=\"同出号码统计表\"><input onClick=\"chartOpen(21206, 0, 0, '', 1)\" class=\"tbbot\" type=\"button\" value=\"相生相克统计表\"></div><div class=hover id=\"show2\"  style=\"display: none\"><input onClick=\"chartOpen(20003, 0, 0, '', 2)\" class=\"tbbot\" type=\"button\" value=\"定位走势图\"><input onClick=\"chartOpen(20009, 0, 0, '', 2)\" class=\"tbbot\" type=\"button\" value=\"和值走势图\"><input onClick=\"chartOpen(5052, 0, 0, '', 2)\" class=\"tbbot\" type=\"button\" value=\"跨度值走势\"><input onClick=\"chartOpen(5053, 0, 0, '', 2)\" class=\"tbbot\" type=\"button\" value=\"最大号码走势\"><input onClick=\"chartOpen(5054, 0, 0, '', 2)\" class=\"tbbot\" type=\"button\" value=\"最小号码走势\"><input onClick=\"chartOpen(5055, 0, 0, '', 2)\" class=\"tbbot\" type=\"button\" value=\"和尾值走势\"><input onClick=\"chartOpen(5057, 0, 0, '', 2)\" class=\"tbbot\" type=\"button\" value=\"平均值走势\"><input onClick=\"chartOpen(5060, 0, 0, '', 2)\" class=\"tbbot\" type=\"button\" value=\"合跨和走势\"><input onClick=\"chartOpen(5061, 0, 0, '', 2)\" class=\"tbbot\" type=\"button\" value=\"合跨差走势\"><input onClick=\"chartOpen(20015, 0, 0, '', 2)\" class=\"tbbot\" type=\"button\" value=\"余数和走势图\"><input onClick=\"chartOpen(5021, 0, 0, '', 2)\" class=\"tbbot\" type=\"button\" value=\"奇号个数走势\"><input onClick=\"chartOpen(5022, 0, 0, '', 2)\" class=\"tbbot\" type=\"button\" value=\"大号个数走势\"><input onClick=\"chartOpen(5024, 0, 0, '', 2)\" class=\"tbbot\" type=\"button\" value=\"质号个数走势\"><input onClick=\"chartOpen(5026, 0, 0, '', 2)\" class=\"tbbot\" type=\"button\" value=\"0路个数走势\"><input onClick=\"chartOpen(5027, 0, 0, '', 2)\" class=\"tbbot\" type=\"button\" value=\"1路个数走势\"><input onClick=\"chartOpen(5028, 0, 0, '', 2)\" class=\"tbbot\" type=\"button\" value=\"2路个数走势\"></div><div class=hover id=\"show3\"  style=\"display: none\"><input onClick=\"chartOpen(20343, 0, 0, '', 3)\" class=\"tbbot\" type=\"button\" value=\"基本号码统计\"><input onClick=\"chartOpen(5051, 0, 0, '', 3)\" class=\"tbbot\" type=\"button\" value=\"和数值统计\"><input onClick=\"chartOpen(5052, 0, 0, '', 3)\" class=\"tbbot\" type=\"button\" value=\"跨度值统计\"><input onClick=\"chartOpen(5053, 0, 0, '', 3)\" class=\"tbbot\" type=\"button\" value=\"最大号码统计\"><input onClick=\"chartOpen(5054, 0, 0, '', 3)\" class=\"tbbot\" type=\"button\" value=\"最小号码统计\"><input onClick=\"chartOpen(5055, 0, 0, '', 3)\" class=\"tbbot\" type=\"button\" value=\"和尾值统计\"><input onClick=\"chartOpen(5097, 0, 0, '', 3)\" class=\"tbbot\" type=\"button\" value=\"首尾和值统计\"><input onClick=\"chartOpen(5057, 0, 0, '', 3)\" class=\"tbbot\" type=\"button\" value=\"平均值统计\"><input onClick=\"chartOpen(5060, 0, 0, '', 3)\" class=\"tbbot\" type=\"button\" value=\"合跨和统计\"><input onClick=\"chartOpen(5061, 0, 0, '', 3)\" class=\"tbbot\" type=\"button\" value=\"合跨差统计\"><input onClick=\"chartOpen(5011, 0, 0, '', 3)\" class=\"tbbot\" type=\"button\" value=\"奇偶比统计\"><input onClick=\"chartOpen(5012, 0, 0, '', 3)\" class=\"tbbot\" type=\"button\" value=\"大小比统计\"><input onClick=\"chartOpen(5013, 0, 0, '', 3)\" class=\"tbbot\" type=\"button\" value=\"质合比统计\"></div><div class=hover id=\"show4\"  style=\"display: none\"><input onClick=\"chartOpen(20343, 0, 0, '', 4)\" class=\"tbbot\" type=\"button\" value=\"基本号码遗漏\"><input onClick=\"chartOpen(20344, 0, 0, '', 4)\" class=\"tbbot\" type=\"button\" value=\"定位号码遗漏\"><input onClick=\"chartOpen(5051, 0, 0, '', 4)\" class=\"tbbot\" type=\"button\" value=\"和数值遗漏\"><input onClick=\"chartOpen(5052, 0, 0, '', 4)\" class=\"tbbot\" type=\"button\" value=\"跨度值遗漏\"><input onClick=\"chartOpen(5053, 0, 0, '', 4)\" class=\"tbbot\" type=\"button\" value=\"最大号码遗漏\"><input onClick=\"chartOpen(5054, 0, 0, '', 4)\" class=\"tbbot\" type=\"button\" value=\"最小号码遗漏\"><input onClick=\"chartOpen(5055, 0, 0, '', 4)\" class=\"tbbot\" type=\"button\" value=\"和尾值遗漏\"><input onClick=\"chartOpen(5097, 0, 0, '', 4)\" class=\"tbbot\" type=\"button\" value=\"首尾和值遗漏\"><input onClick=\"chartOpen(5057, 0, 0, '', 4)\" class=\"tbbot\" type=\"button\" value=\"平均值遗漏\"><input onClick=\"chartOpen(5001, 0, 0, '', 4)\" class=\"tbbot\" type=\"button\" value=\"奇偶形态遗漏\"><input onClick=\"chartOpen(5006, 0, 0, '', 4)\" class=\"tbbot\" type=\"button\" value=\"尾号大小形态遗漏\"><input onClick=\"chartOpen(5003, 0, 0, '', 4)\" class=\"tbbot\" type=\"button\" value=\"质合形态遗漏\"><input onClick=\"chartOpen(5011, 0, 0, '', 4)\" class=\"tbbot\" type=\"button\" value=\"奇偶比遗漏\"><input onClick=\"chartOpen(5012, 0, 0, '', 4)\" class=\"tbbot\" type=\"button\" value=\"大小比遗漏\"><input onClick=\"chartOpen(5013, 0, 0, '', 4)\" class=\"tbbot\" type=\"button\" value=\"质合比遗漏\"><input onClick=\"chartOpen(21501, 0, 0, '', 4)\" class=\"tbbot\" type=\"button\" value=\"二码组合遗漏\"></div><div class=hover id=\"show5\"  style=\"display: none\"><input onClick=\"chartOpen(20343, 0, 0, '', 5)\" class=\"tbbot\" type=\"button\" value=\"基本号码跟随\"><input onClick=\"chartOpen(5051, 0, 0, '', 5)\" class=\"tbbot\" type=\"button\" value=\"和数值跟随\"><input onClick=\"chartOpen(5052, 0, 0, '', 5)\" class=\"tbbot\" type=\"button\" value=\"跨度值跟随\"><input onClick=\"chartOpen(5053, 0, 0, '', 5)\" class=\"tbbot\" type=\"button\" value=\"最大号码跟随\"><input onClick=\"chartOpen(5054, 0, 0, '', 5)\" class=\"tbbot\" type=\"button\" value=\"最小号码跟随\"><input onClick=\"chartOpen(5055, 0, 0, '', 5)\" class=\"tbbot\" type=\"button\" value=\"和尾值跟随\"><input onClick=\"chartOpen(5097, 0, 0, '', 5)\" class=\"tbbot\" type=\"button\" value=\"首尾和值跟随\"><input onClick=\"chartOpen(5057, 0, 0, '', 5)\" class=\"tbbot\" type=\"button\" value=\"平均值跟随\"><input onClick=\"chartOpen(5060, 0, 0, '', 5)\" class=\"tbbot\" type=\"button\" value=\"合跨和跟随\"><input onClick=\"chartOpen(5061, 0, 0, '', 5)\" class=\"tbbot\" type=\"button\" value=\"合跨差跟随\"><input onClick=\"chartOpen(5011, 0, 0, '', 5)\" class=\"tbbot\" type=\"button\" value=\"奇偶比跟随\"><input onClick=\"chartOpen(5012, 0, 0, '', 5)\" class=\"tbbot\" type=\"button\" value=\"大小比跟随\"><input onClick=\"chartOpen(5013, 0, 0, '', 5)\" class=\"tbbot\" type=\"button\" value=\"质合比跟随\"></div></div></div></div></div><div class=\"box bg_tb_chart\"><div class=\"dr\"><a href=\"#\" onClick=\"chartOpen(20001, 1, 30, '', 0)\">最近30期</a>&nbsp;&nbsp;<a href=\"#\" onClick=\"chartOpen(20001, 1, 50, '', 0)\">最近50期</a>&nbsp;&nbsp;<a href=\"#\" onClick=\"chartOpen(20001, 1, 100, '', 0)\">最近100期</a>&nbsp;&nbsp;<input name=\"minIssue\" type=\"text\" id=\"minIssue\" value=\"2013122\" size=\"7\" />&nbsp;期 至&nbsp;<input name=\"maxIssue\" type=\"text\" id=\"maxIssue\" value=\"2013123\" size=\"7\" />&nbsp;期&nbsp;<input name=\"getIssue\" type=\"button\"  class=\"zh_tybt\" id=\"getIssue\" value=\"查看\"  onClick=\"getSIssue(20001,1,0,'',0)\"/>&nbsp;&nbsp;</div><div class=\"dl\" style=\"padding-top:3px;\">&nbsp;&nbsp;<input name=\"\" id=\"c_yl\" type=\"checkbox\" value=\"checkbox\" />隐藏遗漏<input name=\"\" id=\"yl_zhu\" type=\"checkbox\" value=\"checkbox\" />遗漏分层<input name=\"\" id=\"c_v\" type=\"checkbox\" value=\"checkbox\" />重号<input name=\"\" id=\"c_h\" type=\"checkbox\" value=\"\" />连号<input name=\"\" id=\"c_x\" type=\"checkbox\" value=\"checkbox\" />邻号<input name=\"\" id=\"help_line\" type=\"checkbox\" value=\"checkbox\" checked />辅助线<span style=\"display:none\"><select name=\"bitID\" id=\"bitID\"><option value=\"1\">第1位</option></select></span></div></div><input name=\"boxInfo\" type=\"hidden\" id=\"boxInfo\" value=\"1,2,53,11\" /><table align=\"center\" cellpadding=\"0\" cellspacing=\"0\" class=\"tb3\" id=\"chartsTable\"><tr class=\"t1\"><td height=\"25\" width=\"0\" colSpan=\"1\">基本数据区</td><td height=\"25\" width=\"0\" colSpan=\"3\">左延伸区</td><td height=\"25\" width=\"0\" colSpan=\"35\">基本号码分布</td><td height=\"25\" width=\"0\" colSpan=\"3\">右延伸区</td><td height=\"25\" width=\"0\" colSpan=\"12\">后区号码分布图</td></tr><tr class=\"t2\"><td height=\"25\" title=\"期号\" >期号</td><td title=\"33\" >33</td><td title=\"34\" >34</td><td title=\"35\" >35</td><td title=\"01\" >01</td><td title=\"02\" >02</td><td title=\"03\" >03</td><td title=\"04\" >04</td><td title=\"05\" >05</td><td title=\"06\" >06</td><td title=\"07\" >07</td><td title=\"08\" >08</td><td title=\"09\" >09</td><td title=\"10\" >10</td><td title=\"11\" >11</td><td title=\"12\" >12</td><td title=\"13\" >13</td><td title=\"14\" >14</td><td title=\"15\" >15</td><td title=\"16\" >16</td><td title=\"17\" >17</td><td title=\"18\" >18</td><td title=\"19\" >19</td><td title=\"20\" >20</td><td title=\"21\" >21</td><td title=\"22\" >22</td><td title=\"23\" >23</td><td title=\"24\" >24</td><td title=\"25\" >25</td><td title=\"26\" >26</td><td title=\"27\" >27</td><td title=\"28\" >28</td><td title=\"29\" >29</td><td title=\"30\" >30</td><td title=\"31\" >31</td><td title=\"32\" >32</td><td title=\"33\" >33</td><td title=\"34\" >34</td><td title=\"35\" >35</td><td title=\"01\" >01</td><td title=\"02\" >02</td><td title=\"03\" >03</td><td title=\"01\" >01</td><td title=\"02\" >02</td><td title=\"03\" >03</td><td title=\"04\" >04</td><td title=\"05\" >05</td><td title=\"06\" >06</td><td title=\"07\" >07</td><td title=\"08\" >08</td><td title=\"09\" >09</td><td title=\"10\" >10</td><td title=\"11\" >11</td><td title=\"12\" >12</td></tr><tr class=\"DatRow\"><td class=\"Issue fgx\" >2013-122</td><td class=\"M_2\" >5</td><td class=\"M_2\" >7</td><td class=\"B_2 fgx\" >35</td><td class=\"M_1\" >3</td><td class=\"M_1\" >3</td><td class=\"M_1\" >1</td><td class=\"M_1\" >4</td><td class=\"M_1\" >5</td><td class=\"M_1\" >2</td><td class=\"M_1\" >11</td><td class=\"M_1\" >19</td><td class=\"M_1\" >21</td><td class=\"M_1\" >10</td><td class=\"M_1\" >4</td><td class=\"M_1\" >11</td><td class=\"M_1\" >6</td><td class=\"M_1\" >2</td><td class=\"B_1\" >15</td><td class=\"M_1\" >3</td><td class=\"B_1 fgx\" >17</td><td class=\"M_1\" >1</td><td class=\"M_1\" >1</td><td class=\"B_1\" >20</td><td class=\"M_1\" >8</td><td class=\"M_1\" >2</td><td class=\"M_1\" >3</td><td class=\"B_1\" >24</td><td class=\"M_1\" >5</td><td class=\"M_1\" >2</td><td class=\"M_1\" >11</td><td class=\"M_1\" >9</td><td class=\"M_1\" >7</td><td class=\"M_1\" >6</td><td class=\"M_1\" >4</td><td class=\"M_1\" >7</td><td class=\"M_1\" >5</td><td class=\"M_1\" >7</td><td class=\"B_1 fgx\" >35</td><td class=\"M_3\" >3</td><td class=\"M_3\" >3</td><td class=\"M_3 fgx\" >1</td><td class=\"M_2\" >3</td><td class=\"M_2\" >12</td><td class=\"M_2\" >1</td><td class=\"B_6\" >04</td><td class=\"M_2\" >4</td><td class=\"M_2 fgx\" >13</td><td class=\"M_2\" >5</td><td class=\"M_2\" >9</td><td class=\"M_2\" >6</td><td class=\"M_2\" >24</td><td class=\"M_2\" >2</td><td class=\"B_6\" >12</td></tr><tr class=\"DatRow\"><td class=\"Issue fgx\" >2013-123</td><td class=\"B_2\" >33</td><td class=\"B_2\" >34</td><td class=\"M_2 fgx\" >1</td><td class=\"M_1\" >4</td><td class=\"B_1\" >02</td><td class=\"M_1\" >2</td><td class=\"M_1\" >5</td><td class=\"M_1\" >6</td><td class=\"M_1\" >3</td><td class=\"M_1\" >12</td><td class=\"M_1\" >20</td><td class=\"B_1\" >09</td><td class=\"B_1\" >10</td><td class=\"M_1\" >5</td><td class=\"M_1\" >12</td><td class=\"M_1\" >7</td><td class=\"M_1\" >3</td><td class=\"M_1\" >1</td><td class=\"M_1\" >4</td><td class=\"M_1 fgx\" >1</td><td class=\"M_1\" >2</td><td class=\"M_1\" >2</td><td class=\"M_1\" >1</td><td class=\"M_1\" >9</td><td class=\"M_1\" >3</td><td class=\"M_1\" >4</td><td class=\"M_1\" >1</td><td class=\"M_1\" >6</td><td class=\"M_1\" >3</td><td class=\"M_1\" >12</td><td class=\"M_1\" >10</td><td class=\"M_1\" >8</td><td class=\"M_1\" >7</td><td class=\"M_1\" >5</td><td class=\"M_1\" >8</td><td class=\"B_1\" >33</td><td class=\"B_1\" >34</td><td class=\"M_1 fgx\" >1</td><td class=\"M_3\" >4</td><td class=\"B_3\" >02</td><td class=\"M_3 fgx\" >2</td><td class=\"M_2\" >4</td><td class=\"M_2\" >13</td><td class=\"M_2\" >2</td><td class=\"M_2\" >1</td><td class=\"B_6\" >05</td><td class=\"M_2 fgx\" >14</td><td class=\"M_2\" >6</td><td class=\"M_2\" >10</td><td class=\"M_2\" >7</td><td class=\"M_2\" >25</td><td class=\"M_2\" >3</td><td class=\"B_6\" >12</td></tr><tr class=\"td tdfc\"><td class=\"fc333 fgx\" colSpan=\"1\">模拟选号1</td><td class=\"borbottom\" title=\"33\">33</td><td class=\"borbottom\" title=\"34\">34</td><td class=\"borbottom fgx\" title=\"35\">35</td><td class=\"borbottom\" title=\"01\">01</td><td class=\"borbottom\" title=\"02\">02</td><td class=\"borbottom\" title=\"03\">03</td><td class=\"borbottom\" title=\"04\">04</td><td class=\"borbottom\" title=\"05\">05</td><td class=\"borbottom\" title=\"06\">06</td><td class=\"borbottom\" title=\"07\">07</td><td class=\"borbottom\" title=\"08\">08</td><td class=\"borbottom\" title=\"09\">09</td><td class=\"borbottom\" title=\"10\">10</td><td class=\"borbottom\" title=\"11\">11</td><td class=\"borbottom\" title=\"12\">12</td><td class=\"borbottom\" title=\"13\">13</td><td class=\"borbottom\" title=\"14\">14</td><td class=\"borbottom\" title=\"15\">15</td><td class=\"borbottom\" title=\"16\">16</td><td class=\"borbottom fgx\" title=\"17\">17</td><td class=\"borbottom\" title=\"18\">18</td><td class=\"borbottom\" title=\"19\">19</td><td class=\"borbottom\" title=\"20\">20</td><td class=\"borbottom\" title=\"21\">21</td><td class=\"borbottom\" title=\"22\">22</td><td class=\"borbottom\" title=\"23\">23</td><td class=\"borbottom\" title=\"24\">24</td><td class=\"borbottom\" title=\"25\">25</td><td class=\"borbottom\" title=\"26\">26</td><td class=\"borbottom\" title=\"27\">27</td><td class=\"borbottom\" title=\"28\">28</td><td class=\"borbottom\" title=\"29\">29</td><td class=\"borbottom\" title=\"30\">30</td><td class=\"borbottom\" title=\"31\">31</td><td class=\"borbottom\" title=\"32\">32</td><td class=\"borbottom\" title=\"33\">33</td><td class=\"borbottom\" title=\"34\">34</td><td class=\"borbottom fgx\" title=\"35\">35</td><td class=\"borbottom\" title=\"01\">01</td><td class=\"borbottom\" title=\"02\">02</td><td class=\"borbottom fgx\" title=\"03\">03</td><td class=\"borbottom\" title=\"01\">01</td><td class=\"borbottom\" title=\"02\">02</td><td class=\"borbottom\" title=\"03\">03</td><td class=\"borbottom\" title=\"04\">04</td><td class=\"borbottom\" title=\"05\">05</td><td class=\"borbottom fgx\" title=\"06\">06</td><td class=\"borbottom\" title=\"07\">07</td><td class=\"borbottom\" title=\"08\">08</td><td class=\"borbottom\" title=\"09\">09</td><td class=\"borbottom\" title=\"10\">10</td><td class=\"borbottom\" title=\"11\">11</td><td class=\"borbottom\" title=\"12\">12</td></tr><tr class=\"td tdfc\"><td class=\"fc333 fgx\" colSpan=\"1\">模拟选号2</td><td class=\"borbottom\" title=\"33\">33</td><td class=\"borbottom\" title=\"34\">34</td><td class=\"borbottom fgx\" title=\"35\">35</td><td class=\"borbottom\" title=\"01\">01</td><td class=\"borbottom\" title=\"02\">02</td><td class=\"borbottom\" title=\"03\">03</td><td class=\"borbottom\" title=\"04\">04</td><td class=\"borbottom\" title=\"05\">05</td><td class=\"borbottom\" title=\"06\">06</td><td class=\"borbottom\" title=\"07\">07</td><td class=\"borbottom\" title=\"08\">08</td><td class=\"borbottom\" title=\"09\">09</td><td class=\"borbottom\" title=\"10\">10</td><td class=\"borbottom\" title=\"11\">11</td><td class=\"borbottom\" title=\"12\">12</td><td class=\"borbottom\" title=\"13\">13</td><td class=\"borbottom\" title=\"14\">14</td><td class=\"borbottom\" title=\"15\">15</td><td class=\"borbottom\" title=\"16\">16</td><td class=\"borbottom fgx\" title=\"17\">17</td><td class=\"borbottom\" title=\"18\">18</td><td class=\"borbottom\" title=\"19\">19</td><td class=\"borbottom\" title=\"20\">20</td><td class=\"borbottom\" title=\"21\">21</td><td class=\"borbottom\" title=\"22\">22</td><td class=\"borbottom\" title=\"23\">23</td><td class=\"borbottom\" title=\"24\">24</td><td class=\"borbottom\" title=\"25\">25</td><td class=\"borbottom\" title=\"26\">26</td><td class=\"borbottom\" title=\"27\">27</td><td class=\"borbottom\" title=\"28\">28</td><td class=\"borbottom\" title=\"29\">29</td><td class=\"borbottom\" title=\"30\">30</td><td class=\"borbottom\" title=\"31\">31</td><td class=\"borbottom\" title=\"32\">32</td><td class=\"borbottom\" title=\"33\">33</td><td class=\"borbottom\" title=\"34\">34</td><td class=\"borbottom fgx\" title=\"35\">35</td><td class=\"borbottom\" title=\"01\">01</td><td class=\"borbottom\" title=\"02\">02</td><td class=\"borbottom fgx\" title=\"03\">03</td><td class=\"borbottom\" title=\"01\">01</td><td class=\"borbottom\" title=\"02\">02</td><td class=\"borbottom\" title=\"03\">03</td><td class=\"borbottom\" title=\"04\">04</td><td class=\"borbottom\" title=\"05\">05</td><td class=\"borbottom fgx\" title=\"06\">06</td><td class=\"borbottom\" title=\"07\">07</td><td class=\"borbottom\" title=\"08\">08</td><td class=\"borbottom\" title=\"09\">09</td><td class=\"borbottom\" title=\"10\">10</td><td class=\"borbottom\" title=\"11\">11</td><td class=\"borbottom\" title=\"12\">12</td></tr><tr class=\"td tdfc\"><td class=\"fc333 fgx\" colSpan=\"1\">模拟选号3</td><td class=\"borbottom\" title=\"33\">33</td><td class=\"borbottom\" title=\"34\">34</td><td class=\"borbottom fgx\" title=\"35\">35</td><td class=\"borbottom\" title=\"01\">01</td><td class=\"borbottom\" title=\"02\">02</td><td class=\"borbottom\" title=\"03\">03</td><td class=\"borbottom\" title=\"04\">04</td><td class=\"borbottom\" title=\"05\">05</td><td class=\"borbottom\" title=\"06\">06</td><td class=\"borbottom\" title=\"07\">07</td><td class=\"borbottom\" title=\"08\">08</td><td class=\"borbottom\" title=\"09\">09</td><td class=\"borbottom\" title=\"10\">10</td><td class=\"borbottom\" title=\"11\">11</td><td class=\"borbottom\" title=\"12\">12</td><td class=\"borbottom\" title=\"13\">13</td><td class=\"borbottom\" title=\"14\">14</td><td class=\"borbottom\" title=\"15\">15</td><td class=\"borbottom\" title=\"16\">16</td><td class=\"borbottom fgx\" title=\"17\">17</td><td class=\"borbottom\" title=\"18\">18</td><td class=\"borbottom\" title=\"19\">19</td><td class=\"borbottom\" title=\"20\">20</td><td class=\"borbottom\" title=\"21\">21</td><td class=\"borbottom\" title=\"22\">22</td><td class=\"borbottom\" title=\"23\">23</td><td class=\"borbottom\" title=\"24\">24</td><td class=\"borbottom\" title=\"25\">25</td><td class=\"borbottom\" title=\"26\">26</td><td class=\"borbottom\" title=\"27\">27</td><td class=\"borbottom\" title=\"28\">28</td><td class=\"borbottom\" title=\"29\">29</td><td class=\"borbottom\" title=\"30\">30</td><td class=\"borbottom\" title=\"31\">31</td><td class=\"borbottom\" title=\"32\">32</td><td class=\"borbottom\" title=\"33\">33</td><td class=\"borbottom\" title=\"34\">34</td><td class=\"borbottom fgx\" title=\"35\">35</td><td class=\"borbottom\" title=\"01\">01</td><td class=\"borbottom\" title=\"02\">02</td><td class=\"borbottom fgx\" title=\"03\">03</td><td class=\"borbottom\" title=\"01\">01</td><td class=\"borbottom\" title=\"02\">02</td><td class=\"borbottom\" title=\"03\">03</td><td class=\"borbottom\" title=\"04\">04</td><td class=\"borbottom\" title=\"05\">05</td><td class=\"borbottom fgx\" title=\"06\">06</td><td class=\"borbottom\" title=\"07\">07</td><td class=\"borbottom\" title=\"08\">08</td><td class=\"borbottom\" title=\"09\">09</td><td class=\"borbottom\" title=\"10\">10</td><td class=\"borbottom\" title=\"11\">11</td><td class=\"borbottom\" title=\"12\">12</td></tr><tr class=\"td tdfc\"><td class=\"fc333 fgx\" colSpan=\"1\">模拟选号4</td><td class=\"borbottom\" title=\"33\">33</td><td class=\"borbottom\" title=\"34\">34</td><td class=\"borbottom fgx\" title=\"35\">35</td><td class=\"borbottom\" title=\"01\">01</td><td class=\"borbottom\" title=\"02\">02</td><td class=\"borbottom\" title=\"03\">03</td><td class=\"borbottom\" title=\"04\">04</td><td class=\"borbottom\" title=\"05\">05</td><td class=\"borbottom\" title=\"06\">06</td><td class=\"borbottom\" title=\"07\">07</td><td class=\"borbottom\" title=\"08\">08</td><td class=\"borbottom\" title=\"09\">09</td><td class=\"borbottom\" title=\"10\">10</td><td class=\"borbottom\" title=\"11\">11</td><td class=\"borbottom\" title=\"12\">12</td><td class=\"borbottom\" title=\"13\">13</td><td class=\"borbottom\" title=\"14\">14</td><td class=\"borbottom\" title=\"15\">15</td><td class=\"borbottom\" title=\"16\">16</td><td class=\"borbottom fgx\" title=\"17\">17</td><td class=\"borbottom\" title=\"18\">18</td><td class=\"borbottom\" title=\"19\">19</td><td class=\"borbottom\" title=\"20\">20</td><td class=\"borbottom\" title=\"21\">21</td><td class=\"borbottom\" title=\"22\">22</td><td class=\"borbottom\" title=\"23\">23</td><td class=\"borbottom\" title=\"24\">24</td><td class=\"borbottom\" title=\"25\">25</td><td class=\"borbottom\" title=\"26\">26</td><td class=\"borbottom\" title=\"27\">27</td><td class=\"borbottom\" title=\"28\">28</td><td class=\"borbottom\" title=\"29\">29</td><td class=\"borbottom\" title=\"30\">30</td><td class=\"borbottom\" title=\"31\">31</td><td class=\"borbottom\" title=\"32\">32</td><td class=\"borbottom\" title=\"33\">33</td><td class=\"borbottom\" title=\"34\">34</td><td class=\"borbottom fgx\" title=\"35\">35</td><td class=\"borbottom\" title=\"01\">01</td><td class=\"borbottom\" title=\"02\">02</td><td class=\"borbottom fgx\" title=\"03\">03</td><td class=\"borbottom\" title=\"01\">01</td><td class=\"borbottom\" title=\"02\">02</td><td class=\"borbottom\" title=\"03\">03</td><td class=\"borbottom\" title=\"04\">04</td><td class=\"borbottom\" title=\"05\">05</td><td class=\"borbottom fgx\" title=\"06\">06</td><td class=\"borbottom\" title=\"07\">07</td><td class=\"borbottom\" title=\"08\">08</td><td class=\"borbottom\" title=\"09\">09</td><td class=\"borbottom\" title=\"10\">10</td><td class=\"borbottom\" title=\"11\">11</td><td class=\"borbottom\" title=\"12\">12</td></tr><tr class=\"td tdfc fgx2\"><td class=\"fc333 fgx\" colSpan=\"1\">模拟选号5</td><td class=\"borbottom\" title=\"33\">33</td><td class=\"borbottom\" title=\"34\">34</td><td class=\"borbottom fgx\" title=\"35\">35</td><td class=\"borbottom\" title=\"01\">01</td><td class=\"borbottom\" title=\"02\">02</td><td class=\"borbottom\" title=\"03\">03</td><td class=\"borbottom\" title=\"04\">04</td><td class=\"borbottom\" title=\"05\">05</td><td class=\"borbottom\" title=\"06\">06</td><td class=\"borbottom\" title=\"07\">07</td><td class=\"borbottom\" title=\"08\">08</td><td class=\"borbottom\" title=\"09\">09</td><td class=\"borbottom\" title=\"10\">10</td><td class=\"borbottom\" title=\"11\">11</td><td class=\"borbottom\" title=\"12\">12</td><td class=\"borbottom\" title=\"13\">13</td><td class=\"borbottom\" title=\"14\">14</td><td class=\"borbottom\" title=\"15\">15</td><td class=\"borbottom\" title=\"16\">16</td><td class=\"borbottom fgx\" title=\"17\">17</td><td class=\"borbottom\" title=\"18\">18</td><td class=\"borbottom\" title=\"19\">19</td><td class=\"borbottom\" title=\"20\">20</td><td class=\"borbottom\" title=\"21\">21</td><td class=\"borbottom\" title=\"22\">22</td><td class=\"borbottom\" title=\"23\">23</td><td class=\"borbottom\" title=\"24\">24</td><td class=\"borbottom\" title=\"25\">25</td><td class=\"borbottom\" title=\"26\">26</td><td class=\"borbottom\" title=\"27\">27</td><td class=\"borbottom\" title=\"28\">28</td><td class=\"borbottom\" title=\"29\">29</td><td class=\"borbottom\" title=\"30\">30</td><td class=\"borbottom\" title=\"31\">31</td><td class=\"borbottom\" title=\"32\">32</td><td class=\"borbottom\" title=\"33\">33</td><td class=\"borbottom\" title=\"34\">34</td><td class=\"borbottom fgx\" title=\"35\">35</td><td class=\"borbottom\" title=\"01\">01</td><td class=\"borbottom\" title=\"02\">02</td><td class=\"borbottom fgx\" title=\"03\">03</td><td class=\"borbottom\" title=\"01\">01</td><td class=\"borbottom\" title=\"02\">02</td><td class=\"borbottom\" title=\"03\">03</td><td class=\"borbottom\" title=\"04\">04</td><td class=\"borbottom\" title=\"05\">05</td><td class=\"borbottom fgx\" title=\"06\">06</td><td class=\"borbottom\" title=\"07\">07</td><td class=\"borbottom\" title=\"08\">08</td><td class=\"borbottom\" title=\"09\">09</td><td class=\"borbottom\" title=\"10\">10</td><td class=\"borbottom\" title=\"11\">11</td><td class=\"borbottom\" title=\"12\">12</td></tr><tr id=\"trYXid\" class=\"td tdfc fc333 tdLink\"><td class=\"fc333 fgx\" height=\"24\" colSpan=\"1\">历史总出现次数</td><td class=\"dotlitt\">224</td><td class=\"dotlitt\">176</td><td class=\"dotlitt fgx\">205</td><td class=\"dotlitt\">138</td><td class=\"dotlitt\">131</td><td class=\"dotlitt\">129</td><td class=\"dotlitt\">95</td><td class=\"dotlitt\">138</td><td class=\"dotlitt\">135</td><td class=\"dotlitt\">132</td><td class=\"dotlitt\">115</td><td class=\"dotlitt\">128</td><td class=\"dotlitt\">142</td><td class=\"dotlitt\">144</td><td class=\"dotlitt\">126</td><td class=\"dotlitt\">147</td><td class=\"dotlitt\">131</td><td class=\"dotlitt\">105</td><td class=\"dotlitt\">94</td><td class=\"dotlitt fgx\">120</td><td class=\"dotlitt\">125</td><td class=\"dotlitt\">144</td><td class=\"dotlitt\">117</td><td class=\"dotlitt\">127</td><td class=\"dotlitt\">162</td><td class=\"dotlitt\">147</td><td class=\"dotlitt\">140</td><td class=\"dotlitt\">152</td><td class=\"dotlitt\">130</td><td class=\"dotlitt\">147</td><td class=\"dotlitt\">128</td><td class=\"dotlitt\">207</td><td class=\"dotlitt\">190</td><td class=\"dotlitt\">181</td><td class=\"dotlitt\">208</td><td class=\"dotlitt\">224</td><td class=\"dotlitt\">176</td><td class=\"dotlitt fgx\">205</td><td class=\"dotlitt\">138</td><td class=\"dotlitt\">131</td><td class=\"dotlitt fgx\">129</td><td class=\"dotlitt\">171</td><td class=\"dotlitt\">163</td><td class=\"dotlitt\">165</td><td class=\"dotlitt\">156</td><td class=\"dotlitt\">164</td><td class=\"dotlitt fgx\">172</td><td class=\"dotlitt\">161</td><td class=\"dotlitt\">167</td><td class=\"dotlitt\">176</td><td class=\"dotlitt\">201</td><td class=\"dotlitt\">157</td><td class=\"dotlitt\">171</td></tr><tr id=\"trYXid\" class=\"td tdfc fc333 tdLink\"><td class=\"fc333 fgx\" height=\"24\" colSpan=\"1\">历史平均遗漏值</td><td class=\"dotlitt \">3</td><td class=\"dotlitt \">5</td><td class=\"dotlitt  fgx\">4</td><td class=\"dotlitt \">6</td><td class=\"dotlitt \">7</td><td class=\"dotlitt \">7</td><td class=\"dotlitt \">10</td><td class=\"dotlitt \">6</td><td class=\"dotlitt \">6</td><td class=\"dotlitt \">7</td><td class=\"dotlitt \">8</td><td class=\"dotlitt \">7</td><td class=\"dotlitt \">6</td><td class=\"dotlitt \">6</td><td class=\"dotlitt \">7</td><td class=\"dotlitt \">6</td><td class=\"dotlitt \">7</td><td class=\"dotlitt \">9</td><td class=\"dotlitt \">10</td><td class=\"dotlitt  fgx\">7</td><td class=\"dotlitt \">7</td><td class=\"dotlitt \">6</td><td class=\"dotlitt \">8</td><td class=\"dotlitt \">7</td><td class=\"dotlitt \">5</td><td class=\"dotlitt \">6</td><td class=\"dotlitt \">6</td><td class=\"dotlitt \">6</td><td class=\"dotlitt \">7</td><td class=\"dotlitt \">6</td><td class=\"dotlitt \">7</td><td class=\"dotlitt \">4</td><td class=\"dotlitt \">4</td><td class=\"dotlitt \">5</td><td class=\"dotlitt \">4</td><td class=\"dotlitt \">3</td><td class=\"dotlitt \">5</td><td class=\"dotlitt  fgx\">4</td><td class=\"dotlitt \">6</td><td class=\"dotlitt \">7</td><td class=\"dotlitt  fgx\">7</td><td class=\"dotlitt \">5</td><td class=\"dotlitt \">5</td><td class=\"dotlitt \">5</td><td class=\"dotlitt \">5</td><td class=\"dotlitt \">5</td><td class=\"dotlitt  fgx\">5</td><td class=\"dotlitt \">5</td><td class=\"dotlitt \">5</td><td class=\"dotlitt \">5</td><td class=\"dotlitt \">4</td><td class=\"dotlitt \">5</td><td class=\"dotlitt \">5</td></tr><tr id=\"trYXid\" class=\"td tdfc fc333 tdLink\"><td class=\"fc333 fgx\" height=\"24\" colSpan=\"1\">历史最大遗漏值</td><td class=\"dotlitt\">33</td><td class=\"dotlitt\">63</td><td class=\"dotlitt fgx\">24</td><td class=\"dotlitt\">28</td><td class=\"dotlitt\">37</td><td class=\"dotlitt\">41</td><td class=\"dotlitt\">49</td><td class=\"dotlitt\">29</td><td class=\"dotlitt\">38</td><td class=\"dotlitt\">30</td><td class=\"dotlitt\">36</td><td class=\"dotlitt\">34</td><td class=\"dotlitt\">38</td><td class=\"dotlitt\">28</td><td class=\"dotlitt\">46</td><td class=\"dotlitt\">30</td><td class=\"dotlitt\">38</td><td class=\"dotlitt\">38</td><td class=\"dotlitt\">68</td><td class=\"dotlitt fgx\">48</td><td class=\"dotlitt\">25</td><td class=\"dotlitt\">37</td><td class=\"dotlitt\">40</td><td class=\"dotlitt\">57</td><td class=\"dotlitt\">28</td><td class=\"dotlitt\">41</td><td class=\"dotlitt\">37</td><td class=\"dotlitt\">24</td><td class=\"dotlitt\">46</td><td class=\"dotlitt\">33</td><td class=\"dotlitt\">38</td><td class=\"dotlitt\">22</td><td class=\"dotlitt\">23</td><td class=\"dotlitt\">31</td><td class=\"dotlitt\">19</td><td class=\"dotlitt\">33</td><td class=\"dotlitt\">63</td><td class=\"dotlitt fgx\">24</td><td class=\"dotlitt\">28</td><td class=\"dotlitt\">37</td><td class=\"dotlitt fgx\">41</td><td class=\"dotlitt\">40</td><td class=\"dotlitt\">35</td><td class=\"dotlitt\">30</td><td class=\"dotlitt\">30</td><td class=\"dotlitt\">24</td><td class=\"dotlitt fgx\">29</td><td class=\"dotlitt\">26</td><td class=\"dotlitt\">27</td><td class=\"dotlitt\">26</td><td class=\"dotlitt\">25</td><td class=\"dotlitt\">37</td><td class=\"dotlitt\">30</td></tr><tr id=\"trYXid\" class=\"td tdfc fc333 tdLink\"><td class=\"fc333 fgx\" height=\"24\" colSpan=\"1\">历史最大连出值</td><td class=\"dotlitt\">3</td><td class=\"dotlitt\">5</td><td class=\"dotlitt fgx\">4</td><td class=\"dotlitt\">4</td><td class=\"dotlitt\">3</td><td class=\"dotlitt\">4</td><td class=\"dotlitt\">2</td><td class=\"dotlitt\">3</td><td class=\"dotlitt\">2</td><td class=\"dotlitt\">3</td><td class=\"dotlitt\">3</td><td class=\"dotlitt\">3</td><td class=\"dotlitt\">3</td><td class=\"dotlitt\">3</td><td class=\"dotlitt\">3</td><td class=\"dotlitt\">5</td><td class=\"dotlitt\">3</td><td class=\"dotlitt\">2</td><td class=\"dotlitt\">2</td><td class=\"dotlitt fgx\">3</td><td class=\"dotlitt\">3</td><td class=\"dotlitt\">2</td><td class=\"dotlitt\">3</td><td class=\"dotlitt\">3</td><td class=\"dotlitt\">3</td><td class=\"dotlitt\">3</td><td class=\"dotlitt\">3</td><td class=\"dotlitt\">3</td><td class=\"dotlitt\">3</td><td class=\"dotlitt\">3</td><td class=\"dotlitt\">3</td><td class=\"dotlitt\">5</td><td class=\"dotlitt\">3</td><td class=\"dotlitt\">4</td><td class=\"dotlitt\">5</td><td class=\"dotlitt\">3</td><td class=\"dotlitt\">5</td><td class=\"dotlitt fgx\">4</td><td class=\"dotlitt\">4</td><td class=\"dotlitt\">3</td><td class=\"dotlitt fgx\">4</td><td class=\"dotlitt\">5</td><td class=\"dotlitt\">3</td><td class=\"dotlitt\">3</td><td class=\"dotlitt\">3</td><td class=\"dotlitt\">3</td><td class=\"dotlitt fgx\">4</td><td class=\"dotlitt\">3</td><td class=\"dotlitt\">4</td><td class=\"dotlitt\">4</td><td class=\"dotlitt\">4</td><td class=\"dotlitt\">3</td><td class=\"dotlitt\">3</td></tr><tr class=\"t2\"><td height=\"25\" title=\"期号\" >期号</td><td title=\"33\" >33</td><td title=\"34\" >34</td><td title=\"35\" >35</td><td title=\"01\" >01</td><td title=\"02\" >02</td><td title=\"03\" >03</td><td title=\"04\" >04</td><td title=\"05\" >05</td><td title=\"06\" >06</td><td title=\"07\" >07</td><td title=\"08\" >08</td><td title=\"09\" >09</td><td title=\"10\" >10</td><td title=\"11\" >11</td><td title=\"12\" >12</td><td title=\"13\" >13</td><td title=\"14\" >14</td><td title=\"15\" >15</td><td title=\"16\" >16</td><td title=\"17\" >17</td><td title=\"18\" >18</td><td title=\"19\" >19</td><td title=\"20\" >20</td><td title=\"21\" >21</td><td title=\"22\" >22</td><td title=\"23\" >23</td><td title=\"24\" >24</td><td title=\"25\" >25</td><td title=\"26\" >26</td><td title=\"27\" >27</td><td title=\"28\" >28</td><td title=\"29\" >29</td><td title=\"30\" >30</td><td title=\"31\" >31</td><td title=\"32\" >32</td><td title=\"33\" >33</td><td title=\"34\" >34</td><td title=\"35\" >35</td><td title=\"01\" >01</td><td title=\"02\" >02</td><td title=\"03\" >03</td><td title=\"01\" >01</td><td title=\"02\" >02</td><td title=\"03\" >03</td><td title=\"04\" >04</td><td title=\"05\" >05</td><td title=\"06\" >06</td><td title=\"07\" >07</td><td title=\"08\" >08</td><td title=\"09\" >09</td><td title=\"10\" >10</td><td title=\"11\" >11</td><td title=\"12\" >12</td></tr><tr class=\"t1\"><td height=\"25\" width=\"0\" colSpan=\"1\">基本数据区</td><td height=\"25\" width=\"0\" colSpan=\"3\">左延伸区</td><td height=\"25\" width=\"0\" colSpan=\"35\">基本号码分布</td><td height=\"25\" width=\"0\" colSpan=\"3\">右延伸区</td><td height=\"25\" width=\"0\" colSpan=\"12\">后区号码分布图</td></tr></table>";
		String regex="<table[^>]*>(.*)</table>";	//java 正则不识别\s \S等这些标记
		Pattern pattern =Pattern.compile(regex, Pattern.DOTALL);
		
		Matcher matcher = pattern.matcher(str);
		if(matcher.find()){				//在匹配字符之前find()是必须调用的.这个函数是触发
			String tmpStr1 = matcher.group();
			System.out.println(tmpStr1);
			
			String xmlStr = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?><root>"+tmpStr1+"</root>";
			
			SAXReader reader = new SAXReader();
			Document  doc = reader.read(new ByteArrayInputStream(xmlStr.getBytes()));
			Element rootElm = doc.getRootElement(); 
			Element tableE = rootElm.element("table");
			
			List<Element> trListElement = tableE.elements("tr");
			for(Element trE : trListElement){
				String trAttValue = trE.attributeValue("class");
				if(!(trAttValue.contains("DatRow") || trAttValue.contains("fc333"))){
					continue;
				}
				List<Element> tdListElement = trE.elements("td");
				
				StringBuilder strBu = new StringBuilder();
				int historyNumber = 1;
				for(int index=0; index < tdListElement.size(); index++){
					if((index > 0 && index < 4) || (index > 38 && index < 42)){
						continue;
					}
					Element tdE = tdListElement.get(index);
					String tdAttValue = tdE.attributeValue("class");
					if(trAttValue.contains("DatRow")){	//中奖号
						if(tdAttValue.contains("Issue")){
							String number = tdE.getTextTrim();
							strBu.append(number).append("==>");
						}
						if(tdAttValue.contains("B_")){
							strBu.append(tdE.getTextTrim()).append(" ");
						}
					}else if(trAttValue.contains("fc333")){	//历史数据统计
						if(tdAttValue.contains("fc333")){
							String name = tdE.getTextTrim();
							strBu.append(name).append("==>");
						}else{
							strBu.append(historyNumber).append(":").append(tdE.getTextTrim()).append(" ");
							if(historyNumber >= 35){	//后12,重新计算
								historyNumber = 0;
							}
							historyNumber++;
						}
					}
				}
				System.out.println(strBu.toString());
			}
		}
	}
	
	/**
	 * 获得n组随机组合
	 * @param n
	 */
	private static void getRandomCombination(int n){
		Map<Integer, String> lotteryMap = new HashMap<Integer, String>();
		while(n-- >0){
			int[] intArr = new int[7];
			long thirtyFive = 0x0;
			int twelve = 0x0;
			
			int count = 0;
			while(count < 5){
				int num = new Random().nextInt(35) + 1;
				if(((thirtyFive >> num) & 0x1) == 1){
					continue;
				}
				intArr[count] = num;
				thirtyFive = (long)(0x1 << num) | thirtyFive;
				count++;
			}
			while(count < 7){
				int num = new Random().nextInt(12) + 1;
				if(((twelve >> num) & 0x1) == 1){
					continue;
				}
				intArr[count] = num;
				twelve = (0x1 << num) | twelve;
				count++;
			}
			//前5位排序
			for(int i=0;i<intArr.length-2;i++){
				for(int j=0;j<intArr.length-i-3;j++){
					if(intArr[j] > intArr[j+1]){
						int tmp = intArr[j+1];
						intArr[j+1] = intArr[j];
						intArr[j] = tmp;
					}
				}
			}
			//后2位排序
			if(intArr[5] > intArr[6]){
				int tmp = intArr[5];
				intArr[5] = intArr[6];
				intArr[6] = tmp;
			}
			StringBuilder strBu = new StringBuilder();
			for(int i=0;i<intArr.length;i++){
				if(i == intArr.length - 1){
					strBu.append(intArr[i]);
				}else{
					strBu.append(intArr[i]).append(" ");
				}
			}
			int key = Math.abs(strBu.toString().hashCode());
			if(lotteryMap.containsKey(key)){
				n++;	//再来一次
				System.out.println("repeat......");
				continue;
			}
			lotteryMap.put(key, strBu.toString());
		}
		
		for(Entry<Integer, String> entry : lotteryMap.entrySet()){
			System.out.println(entry.getValue());
		}
	}
	/**
	 * 用BigInteger计算阶乘
	 * @param n
	 * @return
	 */
	public static BigInteger getFactorial(int n) {
        BigInteger result = new BigInteger("1");  
        if (n < 0) {  
            System.err.println("n must be great than 0");  
            return new BigInteger("-1");  
        } else if (n == 0) {  
            return new BigInteger("0");  
        } else {  
            for (int i = 1; i <= n; i++) {  
                BigInteger num = new BigInteger(String.valueOf(i));  
                result = result.multiply(num);  
            }  
            return result;  
        }  
    }
	/**
	 * n选k的组合数
	 * @param n
	 * @return
	 */
	public static BigInteger getFactorial(int n, int k) {
		BigInteger countBigInt = getFactorial(n).divide((getFactorial(k).multiply(getFactorial(n - k))));
		System.out.println("the factorial===>"+countBigInt.longValue());
		return countBigInt;
    }
	/**
	 * 随机命中列出指定数字的全组合(不可取,当组合接近饱和时,随机命中越来越几率越来越小)
	 * @param firstArr
	 * @param secondArr
	 */
	private static void getRemainRandomCombination(int[] firstArr, int[] secondArr){
		int firstLen = firstArr.length;
		int secondLen = secondArr.length;
		
		Map<Integer, String> lotteryMap = new HashMap<Integer, String>();
		Map<Integer, String> fiveMap = new HashMap<Integer, String>();
		Map<Integer, String> twoMap = new HashMap<Integer, String>();
		//组合公式 = n!/(k! * (n - k)!)
		int n = 35;
		int k = 5 - firstLen;
		BigInteger countBigInt = getFactorial(n).divide((getFactorial(k).multiply(getFactorial(n - k))));
		long count = countBigInt.longValue();
		while(count-- > 0){
			int[] intArr = new int[5];
			long thirtyFive = 0x0;
			for(int i=0;i<firstLen;i++){	//将设定号码添到标志位和数组中
				int num = firstArr[i];
				intArr[i] = num;
				thirtyFive = (long)(0x1 << num) | thirtyFive;
			}
			int tmpLen = 5 - firstLen - 1 < 0 ? 0 : 5 - firstLen - 1;
			while(tmpLen < 5){
				int num = new Random().nextInt(35) + 1;
				if(((thirtyFive >> num) & 0x1) == 1){
					continue;
				}
				intArr[tmpLen] = num;
				thirtyFive = (long)(0x1 << num) | thirtyFive;
				tmpLen++;
			}
			for(int i=0;i<intArr.length;i++){
				for(int j=0;j<intArr.length-i-1;j++){
					if(intArr[j] > intArr[j+1]){
						int tmp = intArr[j+1];
						intArr[j+1] = intArr[j];
						intArr[j] = tmp;
					}
				}
			}
			StringBuilder strBu = new StringBuilder();
			for(int i=0;i<intArr.length;i++){
				if(i == intArr.length - 1){
					strBu.append(intArr[i]);
				}else{
					strBu.append(intArr[i]).append(" ");
				}
			}
			int key = Math.abs(strBu.toString().hashCode());
			/*if(fiveMap.containsKey(key) && fiveMap.size() < countBigInt.longValue()){
				count++;	//再来一次
				System.out.println("repeat......");
				continue;
			}*/
			fiveMap.put(key, strBu.toString());
		}
		
		n = 12;
		k = 2 - secondLen;
		if(k > 0){
			countBigInt = getFactorial(n).divide((getFactorial(k).multiply(getFactorial(n - k))));
			count = countBigInt.longValue();
			while(count-- > 0){
				int[] intArr = new int[2];
				long twelve = 0x0;
				for(int i=0;i<secondLen;i++){	//将设定号码添到标志位和数组中
					int num = secondArr[i];
					intArr[i] = num;
					twelve = (long)(0x1 << num) | twelve;
				}
				int tmpLen = 2 - secondLen;
				while(tmpLen < 2){
					int num = new Random().nextInt(12) + 1;
					if(((twelve >> num) & 0x1) == 1){
						continue;
					}
					intArr[tmpLen] = num;
					twelve = (long)(0x1 << num) | twelve;
					tmpLen++;
				}
				if(intArr[0] > intArr[1]){
					int tmp = intArr[1];
					intArr[1] = intArr[0];
					intArr[0] = tmp;
				}
				StringBuilder strBu = new StringBuilder();
				for(int i=0;i<intArr.length;i++){
					if(i == intArr.length - 1){
						strBu.append(intArr[i]);
					}else{
						strBu.append(intArr[i]).append(" ");
					}
				}
				int key = Math.abs(strBu.toString().hashCode());
				/*if(twoMap.containsKey(key) && twoMap.size() < countBigInt.longValue()){
					count++;	//再来一次
					System.out.println("repeat......");
					continue;
				}*/
				twoMap.put(key, strBu.toString());
			}
		}else{
			if(secondArr[0] > secondArr[1]){
				int tmp = secondArr[1];
				secondArr[1] = secondArr[0];
				secondArr[0] = tmp;
			}
			String tmp = secondArr[0]+" "+secondArr[1];
			twoMap.put(Math.abs(tmp.hashCode()), tmp);
		}
		
		
		//前后再组合= fiveMap.size * twoMap.size
		for(String twoStr : twoMap.values()){
			for(String fiveStr : fiveMap.values()){
				System.out.println(fiveStr+" "+twoStr);
			}
		}
		System.out.println("the combination count=====>"+fiveMap.size() * twoMap.size());
	}
	
	/**
	 * 交换数组元素
	 * @param intArr
	 * @param m
	 * @param n
	 */
	private static void swapListElement(int[] intArr, int m, int n){
		if(m == n) return;
		
		int tmp = intArr[m];
		intArr[m] = intArr[n];
		intArr[n] = tmp;
	}
	
	/**
	 * 获取数组全组合(递归算法)
	 * @param intArr
	 * @param k
	 * @param m
	 */
	public static void fullCombination(int[] intArr, int k, int m){
		int i = 0;
		if(k > m){
			for(;i <= m; i++){
				System.out.print(intArr[i]+" ");
			}
			System.out.println("");
		}else{
			for(i=k; i<=m; i++){
				swapListElement(intArr, k, i);
				fullCombination(intArr, k + 1, m);
				swapListElement(intArr, k, i);
			}
		}
	}
	
	/**
	 * 获得指定长度指定元素的2维数组
	 * @param start
	 * @param end
	 * @param count
	 * @return
	 */
	private static int[][] getIntArr(int start, int end, int count){
		int total = end-count + 1;
		int[][] retArr = new int[total][count];
		
		int m = start;
		for(int i=0; i<total; i++){
			StringBuilder strBu = new StringBuilder();
			int num = m;
			for(int j=start; j<count; j++){
				++num;
				retArr[i][j] = num;
				strBu.append(num).append(" ");
			}
			System.out.println(strBu.toString());
			m++;
		}
		return retArr;
	}
	
	/**
	 * 获得指定长度指定元素的2维数组
	 * @param start
	 * @param end
	 * @param count
	 * @return
	 */
	private static void getIntArr1(int start, int end, int count){
		
		int totalCount = 0;
		for(int index=start; index<end-count; index++){
			int[] intArr = new int[count];
			
			StringBuilder strBu = new StringBuilder();
			int num = index;
			for(int j=start; j<count; j++){
				intArr[j] = ++num;
				strBu.append(intArr[j]).append(" ");
			}
			System.out.println(strBu.toString());
			totalCount++;
			
			for(int m=1; m<count; m++){
				int[] tmpArr = new int[count];
				System.arraycopy(intArr, 0, tmpArr, 0, 5);
				for(int i=num+1; i<=end; i++){
					tmpArr[m] = i;
					strBu = new StringBuilder();
					for(int j=0;j<count;j++){
						strBu.append(tmpArr[j]).append(" ");
					}
					totalCount++;
					System.out.println(strBu.toString());
				}
			}
			
			for(int x=1; x<end-count-1; x++){
				
			}
		}
		System.out.println("the totalCount===>"+totalCount);
	}
	
	private static void getIntArr2(int totalcount, int size, int start, int end){
		int[][] intArr = new int[totalcount][size];
		for(int i=start; i<totalcount; i++){
			for(int j=start; j<size; j++){
				intArr[i][j] = i+1;
			}
		}
	}
	/**
	 * 获取数组全组合(递归算法)
	 * @param intArr
	 * @param k
	 * @param m
	 */
	public static void getfullCombination(int[] intArr, int k, int m, List<String> strList){
		int i = 0;
		if(k > m){
			StringBuilder strBu = new StringBuilder();
			for(;i <= m; i++){
				if(i == m){
					strBu.append(intArr[i]);
				}else{
					strBu.append(intArr[i]).append(" ");
				}
			}
			strList.add(strBu.toString());
		}else{
			for(i=k; i<=m; i++){
				swapListElement(intArr, k, i);
				getfullCombination(intArr, k + 1, m, strList);
				swapListElement(intArr, k, i);
			}
		}
	}
	
	private static void printLottery(){
		List<String> fiveList = new ArrayList<String>();
		List<String> twoList = new ArrayList<String>();
		//获得5个元素的所有组合
		int start = 0, end = 35, count =5;
		int[][] intArr = getIntArr(start, end, count);
		for(int i=0; i<intArr.length; i++){
			
			int[] tmpArr = new int[count];
			for(int j = 0; j<count; j++){
				tmpArr[j] = intArr[i][j];
			}
			getfullCombination(tmpArr, start, count-1, fiveList);
		}
		//获得2个元素的所有组合
		start = 0; end = 12; count =2;
		intArr = getIntArr(start, end, count);
		for(int i=0; i<intArr.length; i++){
			
			int[] tmpArr = new int[count];
			for(int j = 0; j<count; j++){
				tmpArr[j] = intArr[i][j];
			}
			getfullCombination(tmpArr, start, count-1, twoList);
		}
		
	}
	
	/**
	 * 测试memcached数据存取
	 * @param key
	 */
	public static void testGetMemcachedData(String key){
		SockIOPool pool = null;
		
		String poolName = "gift";
		int connSize = 3;
		String[] servers = {"10.144.132.202:11211"};
		Integer[] weights = {3};// server权重
		pool = SockIOPool.getInstance(poolName);
		pool.setServers( servers );
		pool.setWeights( weights ); 
		
		/*String[] servers = {"127.0.0.1:11211"};
		Integer[] weights = {3};
		pool = SockIOPool.getInstance(poolName);
		pool.setServers( servers );
		pool.setWeights( weights );*/
		
		
		pool.setFailover( true );
		// 设置初始连接数、最小和最大连接数
		pool.setInitConn( connSize ); 
		pool.setMinConn( connSize );
		pool.setMaxConn( connSize * 3 );
		// 设置一个连接最大空闲时间6小时
		pool.setMaxIdle( 1000 * 60 * 60 * 6 ); 
		
		// 设置主线程的睡眠时间  (5分钟)
		// pool.setMaintSleep( 300 );  
		
		// 设置TCP的参数 
		// 关闭nagle算法
		pool.setNagle( false );
		// 设置 读取 超时50 毫秒
		pool.setSocketTO( 50 );
		// 不设置连接超时
		pool.setSocketConnectTO(10);
		// 
		pool.setAliveCheck( true );
		
		// 初始化
		pool.initialize();
		
		MemCachedClient memCachedClient = new MemCachedClient(poolName);
		// 设置压缩模式
		//如果超过64k压缩数据
		//memCachedClient.setCompressEnable( true );
		//memCachedClient.setCompressThreshold( 64 * 1024 );

		Object obj = memCachedClient.get(key);
		System.out.println(obj);
		
		
//		memCachedClient.set(key, "haha", new Date(1 * 24 * 60 * 60 * 1000L));
		
	}
	
	public static void testReadFile(){
		String url = "C:\\Users\\smaller\\Desktop\\test.txt";
		String adminHost1 = "http://fxwrc.2022m.nj.twsapp.com/";
		String adminHost2 = "http://localhost:8080/";
		
		try {
			BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(url)));
			String content = reader.readLine();
			while(content != null){
				String[] tmpArr = content.split("[ ]");
				Integer num = Integer.valueOf(tmpArr[0]);
				String playerId = tmpArr[1];
				
				String uri = "admin?cmd=m_UA|"+playerId+"|"+num;
				//拼接Url
				String adminUrl = adminHost1 + uri;
				
				System.out.println(adminUrl);
				
				testHttpUrlConnection(adminUrl);
				
				content = reader.readLine();
			}
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	
	/**
	 * @param second
	 */
	public static void testCalendar(int second){
		Calendar cal = Calendar.getInstance();
   		cal.setTimeInMillis(second * 1000l);
		int dayOfyear = cal.get(Calendar.DAY_OF_YEAR);
		
		System.out.println("dayOfYear:"+dayOfyear);
	}
	
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		//testBoolean();
		
		//testCollectionSort();
		
		//testForLoop();
		
//		testHttpUrlConnection("http://data.lottery.gov.cn/lotdata/WzlChart.dll?wAgent=100&wAction=101&wParam=LotID=23529_ChartID=20001_StatType=0_MinIssue=2013122_MaxIssue=2013123_IssueTop=0_BitID=1&d=1388039418477");
		
		//testList();
		
//		testMySql();
		
//		testUnicode();
		
		//testTimeFormat();
		
//		testInt();
		
//		testXMYAdminIntegerfaceBanAccount();
		
//		getTimeAfterDays(0);
//		getTimeBeforeDays(1);

//		parseTime(1385223009);
		
//		getNum("dda6e5d7c7fd46f882f31e66335d1993",2);
		
//		getBigHashCode("06f9799f00a34cc39ad28b22ba74768c", "663d43334e034a189d5f87116f45f012");
		
//		testJavaUrlEncode();
		
		testFXWRAdminIntegerfaceBanAccount(3, 1, new String[]{"1944981482"});
		
//		testMutilThreadXMYAdminInterface();
		
//		invokeXMYAdminInterface();
//		invokeFxwrAdminInterface();
		
//		testThreadShareData();
		
//		getFxwrSpecialMarkbook("f275bee74d064a46b7b6fdaef758ddc8", 3, false, "p_VS", "");
//		getXMYSpecialMarkbook("2284807", 2, "mi_FMC", "2034");
		
		/*try {
			testRegExpress();
		} catch (DocumentException e) {
			e.printStackTrace();
		}*/
		
//		getRandomCombination(100);
		
//		int[] fiveArr = {3,14,15,27};
//		int[] twoArr = {8,12};
//		getRemainRandomCombination(fiveArr, twoArr);
		
//		fullCombination(new int[]{1,2,3,4,5}, 0, 3);
//		getIntArr(0, 12, 2);
		
//		getIntArr1(0, 35, 5);
		
//		getFactorial(35, 5);
		
//		testGetMemcachedData("zone_honor");
		
//		testReadFile();
		
//		testCalendar(0);
//		testCalendar((int)(System.currentTimeMillis() / 1000L));
	}
}